//
//  YFKaiDianHeaderView.m
//  QuanJieShopProject
//
//  Created by apple on 2018/5/19.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "YFKaiDianHeaderView.h"

@implementation YFKaiDianHeaderView
- (void)awakeFromNib {
    [super awakeFromNib];
    /*
     YFKaiDianHeaderViewTag_Category = 101,
     YFKaiDianHeaderViewTag_Location,
     YFKaiDianHeaderViewTag_IDCardFront,
     YFKaiDianHeaderViewTag_IDCardBack,
     YFKaiDianHeaderViewTag_ShopImgView1,
     YFKaiDianHeaderViewTag_ShopImgView2,
     YFKaiDianHeaderViewTag_ShopImgView3,
     YFKaiDianHeaderViewTag_Agreement,
     YFKaiDianHeaderViewTag_NextStep,
     */
    // 设置tag
    self.chooseBtn.tag = YFKaiDianHeaderViewTag_Category;
    self.locationBtn.tag = YFKaiDianHeaderViewTag_Location;
    self.addressBtn.tag = YFKaiDianHeaderViewTag_Address;
    self.iDCardFront.tag = YFKaiDianHeaderViewTag_IDCardFront;
    self.iDCardBack.tag = YFKaiDianHeaderViewTag_IDCardBack;
    self.shopImgView1.tag = YFKaiDianHeaderViewTag_ShopImgView1;
    self.shopImgView2.tag = YFKaiDianHeaderViewTag_ShopImgView2;
    self.shopImgView3.tag = YFKaiDianHeaderViewTag_ShopImgView3;
    self.agreement.tag = YFKaiDianHeaderViewTag_Agreement;
    self.cardImgView.tag = YFKaiDianHeaderViewTag_BusinessCard;
    self.nextStep.tag = YFKaiDianHeaderViewTag_NextStep;
    self.agreeBtn.tag = YFKaiDianAgreenViewTag_BtnAgreen;
    // 下拉箭头文字改变
    [self.chooseBtn layoutButtonWithEdgeInsetsStyle:LLButtonStyleTextLeft imageTitleSpace:0];
    [self.agreeBtn setImage:[UIImage imageNamed:@"Snoselect"] forState:UIControlStateNormal];
    [self.agreeBtn setImage:[UIImage imageNamed:@"Sselect"] forState:UIControlStateSelected];
}

- (IBAction)headerBtnClickAction:(UIButton *)sender {
    NSInteger tag = sender.tag;
    if (tag == 0) {
        NSLog(@"tag 的值设置错误");
    }
    NSLog(@"点击了按钮 tag = %ld", (long)tag);
    if (self.headerBtnClickBlock) {
        self.headerBtnClickBlock(tag);
    }
}

@end
